package com.example.demo.hutool.http;

import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;

import java.util.HashMap;
import java.util.Map;

public class test {
    public static void main(String[] args) {
        HashMap<String, Object> paramMap = new HashMap<>();
        paramMap.put("city", "北京");
        String params="{\n" +
                "  \"id\": \"8654FF87FC954F078FAEDF4BDE77A66A\",\n" +
                "  \"createUser\": \"admin\",\n" +
                "  \"createTime\": \"2022-08-15 18:23:25\",\n" +
                "  \"modifyUser\": \"admin\",\n" +
                "  \"modifyTime\": \"2022-08-23 14:09:52\",\n" +
                "  \"category\": \"database\",\n" +
                "  \"type\": \"MARIADB\",\n" +
                "  \"ips\": \"172.20.54.124\",\n" +
                "  \"port\": 3066,\n" +
                "  \"username\": \"dscg\",\n" +
                "  \"password\": \"Keo58Sj7eF6a7juidKimkhkO3Q14FxwPjuipeWTJvUE0Q8DMAp7uZgWvkISutHw+PFYmqBiMCqhCAMTkSdglaaMtKpbgizCMJ2/6RTuHMPKVcjw9EhkRWFoxp+hYRwZTGfzFKC2OgqWyLJGIga/4LZOlkl4m5vlpAlV3gKyuTqY=\",\n" +
                "  \"name\": \"sxm-125 MariaDB214\",\n" +
                "  \"resourceCatalogId\": \"0\",\n" +
                "  \"resourceCatalogName\": \"机构\",\n" +
                "  \"nodeIp\": \"172.20.54.125\",\n" +
                "  \"groupId\": \"3D07970DD447412980297CB5B080AB91\",\n" +
                "  \"dataBaseConfig\": {\n" +
                "    \"parameters\": \"serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&useSSL=false\",\n" +
                "    \"instanceName\": \"dscg\",\n" +
                "    \"requestId\": \"\"\n" +
                "  },\n" +
                "  \"authType\": \"user\"\n" +
                "}";

        Map map = JSON.parseObject(params, Map.class);

        String result= HttpUtil.post("https://172.20.54.125:8082/dscg_ws/sys/datasource/testDataBaseConnect", map);

        System.out.println();

    }
}
